// vuex根模块类型
export interface IRootState {
  name: string
  password: string
  breadcrumb?: string[]
  departmentList: any[]
  rolesList: any[]
}

// login模块类型
export interface ILoginState {
  token: string
  userInfo: any
  userMenu: any
  perimssions: string[]
}

//  system模块类型
export interface ISystemState {
  userList: IUserInfo[]
  userCount: number
  roleList: any[]
  roleCount: number
  goodsList: IUserInfo[]
  goodsCount: number
  menuList: IUserInfo[]
  menuCount: number
  departmentList: IUserInfo[]
  departmentCount: number
  categoryCount: number
  categoryList: IUserInfo[]
}
// dashboder模块
export interface IDashboardState {
  categoryGoodsCount: any[]
  categoryGoodsSale: any[]
  categoryGoodsFavor: any[]
  addressGoodsSale: any[]
}

export interface IUserList {
  list: IUserInfo[]
  totalCount: number
}

export interface IUserInfo {
  id: number
  name: string
  realname: string
  cellphone: number
  enable: number
  departmentId: number
  roleId: number
  createAt: string
  updateAt: string
}

// 模块合并类型
export interface IRootWithModel extends ILoginState, ISystemState, IDashboardState {
  login: ILoginState
  system: ISystemState
  dashboard: IDashboardState
}

// 用户账号密码
export interface IAccount {
  name: string
  password: string
}

// 返回结果类型
export interface ILoginResult {
  id: string
  name: string
  token: string
}

// 用户菜单类型
/*Children*/
export interface IChildren {
  id: number
  url: string
  name: string
  sort: number
  type: number
  children: IChildren[] | null
  createAt: string
  parentId: number
  updateAt: string
}
export interface IUserMenu {
  id?: number
  name?: string
  type?: number
  url: string
  icon?: string
  sort?: number
  createAt?: string
  updateAt?: string
  children?: IChildren
}

// 搜索 组件中的类型
export interface ISearchFormItem {
  field: string
  label: string
  placeholder?: string
  elType?: string
  options?: any[]
  otherOption?: any
}

// 搜索 组件配置对象
export interface ISearchFormConfig {
  searchFormItems: ISearchFormItem[]
  itemStyle: any
  labelwidth: string
  cLayout: any
  showHeader?: boolean
  showFooter?: boolean
}

// dialog 组件配置对象
export interface IDialogFormConfig {
  searchFormItems: ISearchFormItem[]
  lablewidth: string
  itemStyle: any
  cLayout: any
  name: string
}

// user传入组件的配置对象
export interface IFormDate {
  id: string
  userName: string
  realName: string
  phoneNumber: string
  select: string
  createTime: string
}

// 查询页面的配置类型
export interface IQueryInfo {
  offset: number
  size: number
  name?: string
  id?: number
}

//user传入的查询列表类型
export interface IQueryPage {
  pageName: string
  queryInfo: IQueryInfo
}

//  新增的数据
export interface IAddPageDate {
  pageName: string
  addInfo: any
}
